create database if not exists test_0828;


 create table if not exists `test_0828`.`teacher_basic` (
   name string,
   age int,
   married boolean,
   children int
 ) row format delimited
 fields terminated by ',';


 create table if not exists `test_0828`.`teacher_info` (
   name string,
   height double
 ) row format delimited
 fields terminated by ',';


load data inpath 'hdfs://ns1/data/sparksql/teacher_basic.txt' overwrite into table `test_0828`.`teacher_basic`;

load data inpath 'hdfs://ns1/data/sparksql/teacher_info.txt' overwrite into table `test_0828`.`teacher_info`;

create table `test_0828`.`teacher`
as select
   b.name,
   b.age,
   b.married,
   b.children,
   i.height
 from `test_0828`.`teacher_basic` b
 inner join `test_0828`.`teacher_info` i on b.name = i.name;
